﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AFSharedLibrary;

namespace UIDesigner.SurfaceProperties.Operations
{
    public class SaveProperties : IPropertyGroup
    {
        [System.Xml.Serialization.XmlIgnore()]
        protected SaveOptions m_eObjectSaveOptions;
        [System.Xml.Serialization.XmlIgnore()]
        protected string m_strSaveMessage;
        [System.Xml.Serialization.XmlIgnore()]
        protected IEventStateValue m_objSaveState;
        [System.Xml.Serialization.XmlIgnore()]
        private PostActions m_ePostActions;

        public SurfaceButton Button
        {
            get
            {
                if (m_eObjectSaveOptions == SaveOptions.SaveButton)
                {
                    return SurfaceButton.Save;
                }
                else if (m_eObjectSaveOptions == SaveOptions.ApplyButton)
                {
                    return SurfaceButton.Save;
                }
                else if (m_eObjectSaveOptions == SaveOptions.AddButton)
                {
                    return SurfaceButton.Save;
                }
                else
                {
                    return SurfaceButton.None;
                }
            }
        }

        public PostActions PostActions
        {
            get { return m_ePostActions; }
            set { m_ePostActions = value; }
        }

        [System.Xml.Serialization.XmlIgnore()]
        public IEventStateValue SaveState
        {
            get
            {
                return m_objSaveState;
            }

            set
            {
                m_objSaveState = value;
            }
        }

        public SaveOptions SaveOptions
        {
            get { return m_eObjectSaveOptions; }
            set { m_eObjectSaveOptions = value; }
        }

        public string SaveMessage
        {
            get
            {
                return m_strSaveMessage;
            }

            set
            {
                m_strSaveMessage = value;
            }
        }

        public SaveProperties()
        {
        }

        public object Clone()
        {
            SaveProperties objProperties = new SaveProperties();

            objProperties.m_eObjectSaveOptions = m_eObjectSaveOptions;
            objProperties.m_strSaveMessage = m_strSaveMessage; 
            objProperties.m_objSaveState = m_objSaveState;
            objProperties.m_ePostActions = m_ePostActions;

            return objProperties;
        }
    }
}
